#ifndef MAINMENU_H
#define MAINMENU_H

#include <QtGui>

#include "commons.h"

class MainMenu : public QObject, public QGraphicsItem
{
    Q_OBJECT
    Q_INTERFACES(QGraphicsItem)
public:
    explicit MainMenu(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    QRectF boundingRect() const;
//    void hoverMoveEvent(QGraphicsSceneHoverEvent *event);

signals:
    void exitClicked();
    void editorClicked();
//    void aboutClicked();
    void levelClicked();

public slots:
    void clicked(ButtonItem *who);

private:
    ImageItem *background;
    DialogItem *aboutDialog;
    ButtonItem *exitBg;
    ButtonItem *optionBg;
    ButtonItem *levelBg;
    ButtonItem *aboutBg;
    ButtonItem *editorBg;

    void initScene();
    void initEventSystem();
    void popupAboutDialog();
    void enableButtons(bool enabled);

private slots:
    void dialogClosed();

};

#endif // MAINMENU_H
